package donnees;

import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;

import fabriques.FabClient;
import fabriques.FabLigneCommande;

public class Commande implements Serializable{
	private static final long serialVersionUID = 4550743532237726546L;
	
	private int id;
	private Date dateC;
	
	
	public Commande(int id, Date dateC) {
		super();
		this.id = id;
		this.dateC = dateC;
	}
	public int getId() {
		return id;
	}
	public Date getDateC() {
		return dateC;
	}
	
	public String getDateCToString() {
		 SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yy");
	     return sdf.format(dateC);
	}
	
	public Client getLeClient(){
		return FabClient.getInstance().rechercherLeClientDeLaCommande(id);
	}
	
	public ArrayList<LigneCommande> getLesLignes(){
		return FabLigneCommande.getInstance().rechercherLesLignesDeLaCommande(id);
	}
	
}
